package by.msokoloff.javaweb2015.webapp.utils.renderer;

import org.apache.wicket.markup.html.form.IChoiceRenderer;

import by.msokoloff.javaweb2015.datamodel.City;

public class CityChoiceRenderer implements IChoiceRenderer<City> {

	public static CityChoiceRenderer INSTANCE = new CityChoiceRenderer();

	private CityChoiceRenderer() {
		super();
	}

	@Override
	public Object getDisplayValue(City city) {
		return city.getName();
	}

	@Override
	public String getIdValue(City city, int index) {
		return city.getId().toString();
	}

}
